package JavaShengSai;

import java.util.Scanner;

/**
 * 6. 跑步锻炼
 * https://www.lanqiao.cn/problems/597/learning/?problem_list_id=2&page=1&tag_relation=intersection&tags=2020
 */
public class Main6 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int year = 2000;
        int month = 1;
        int day = 1;
        int weekend = 6;
        int sum = 0;
        int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
        while(true) {
            if((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) {
                months[2] = 29;
            }else {
                months[2] = 28;
            }

            if(day == 1 || weekend == 1) {
                sum += 2;
            }else {
                sum += 1;
            }

            day++;
            weekend++;

            if(day > months[month]) {
                day = 1;
                month++;
                if(month > 12) {
                    month = 1;
                    year++;
                }
            }

            if(weekend > 7) {
                weekend %= 7;
            }

            if(year == 2020 && month == 10 && day == 1) {
                // 最后一天也是一个1号
                sum += 2;
                break;
            }
        }
        System.out.println(sum);
        scan.close();
    }
}
